#include <iostream>
#include <stdio.h>
using namespace std;

double all_profit(int require,double size[],double profit[],int num)
{
    if(require==0)
    {
        //市场饱和
        return 0;
    }
    double max_single = -1;
    int target = -1;
    //找出获利最多的月饼
    for (int i = 0; i < num; i++)
    {
        if((profit[i]/size[i])>max_single)
        {
            max_single = (profit[i]/size[i]);
            target = i;
        }
    }
    if(max_single == -1)
    {
        //都卖完了
        return 0;
    }
    if(require<size[target])
    {
        //可以满足需求
        return require*max_single;
    }
    //还有市场需求
    require -= size[target];
    double this_profit = profit[target];
    profit[target] = -1;
    size[target] = 0;
    return this_profit + all_profit(require, size, profit, num);
}

int main()
{
    int n, require;
    double size[1010] = {0};
    double profit[1010] = {0};
    cin >> n >> require;
    for (int i = 0; i < n; i++)
    {
        cin >> size[i];
    }
    for (int i = 0; i < n; i++)
    {
        cin >> profit[i];
    }
    printf("%.2f",all_profit(require,size,profit,n));
    return 0;
}